package com.dh.str;

import java.util.Scanner;

public class StringDemo05 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            System.out.println("请输入一个数字：");
            String num = scanner.next();// 0-100
            // 0  08  9  30        100
//            boolean result = num.matches("\\d|\\d{2}|100");
//            boolean result1 = num.matches("\\d{2}");
            boolean result1 = num.matches("[0-9]?\\d|100");
            System.out.println(result1);
        }

    }
}
